useFixture(default)

def test():
	from Modules import commonBits
	java_recorded_version = '1.5.0_11'

	if window('Protocol Buffer Editor'):
		select('FileChooser', commonBits.sampleDir() + 'Ams_LocDownload_20041228.bin')
		#commonBits.setRecordLayout(select, 'ams Store')

		click('Edit1')
		click('Find1')
		#click('MetalInternalFrameTitlePane', 199, 13)
		select('TextField', 'West')
		select('TextField1', 'West_')
		select('ComboBox', 'Loc_Addr_Ln1')
		click('Replace All')
		click('BasicInternalFrameTitlePane$NoFocusButton2')
		select('Table', 'cell:5|Loc_Addr_Ln1,0()')
		rightclick('Table', '2|Loc_Nbr,0')
		select_menu('Edit Record')
		click('Find1')
		#click('MetalInternalFrameTitlePane', 211, 10)
		select('TextField', 'West_')
		click('Find1')
		select('Table', 'cell:Data,4(West_field Shoppingtown)')
		select('Table', 'cell:Data,4(West_field Shoppingtown)')
		assert_p('Table', 'Text', 'Cnr. Urunga Pde & The Kingsway', 'Data,5')
		select('Table', 'cell:Data,4(West_field Shoppingtown)')
		select('Table', 'cell:Data,5(Cnr. Urunga Pde & The Kingsway)')
		assert_p('Table', 'Content', '[[Brand_Id, 1, , TAR, TAR], [Loc_Nbr, 2, , 5037, 5037], [Loc_Type, 3, , ST, ST], [Loc_Name, 4, , Miranda, Miranda], [Loc_Addr_Ln1, 5, , West_field Shoppingtown, West_field Shoppingtown], [Loc_Addr_Ln2, 6, , Cnr. Urunga Pde & The Kingsway, Cnr. Urunga Pde & The Kingsway], [Loc_Addr_Ln3, 7, , Miranda, Miranda], [Loc_Postcode, 8, , 2228, 2228], [Loc_State, 9, , NSW, NSW], [Loc_Actv_Ind, 10, , A, A]]')
		select('Table', 'cell:Data,5(Cnr. Urunga Pde & The Kingsway)')
		click('Find1')
		select('TextField', 'West_')
		click('Find1')
		select('Table', 'cell:Data,4(West_field Phoenix Plaza)')
		assert_p('Table', 'Text', 'Northumberland Street', 'Data,5')
		select('Table', 'cell:Data,5(Northumberland Street)')
		assert_p('Table', 'Content', '[[Brand_Id, 1, , TAR, TAR], [Loc_Nbr, 2, , 5093, 5093], [Loc_Type, 3, , ST, ST], [Loc_Name, 4, , Liverpool, Liverpool], [Loc_Addr_Ln1, 5, , West_field Phoenix Plaza, West_field Phoenix Plaza], [Loc_Addr_Ln2, 6, , Northumberland Street, Northumberland Street], [Loc_Addr_Ln3, 7, , Liverpool, Liverpool], [Loc_Postcode, 8, , 2170, 2170], [Loc_State, 9, , NSW, NSW], [Loc_Actv_Ind, 10, , A, A]]')
		select('Table', 'cell:Data,5(Northumberland Street)')
		click('Find1')
		select('TextField', 'West_')
		click('Find1')
		select('Table', 'cell:Data,4(West_field Shoppingtown Eastgardens)')
		assert_p('Table', 'Text', 'cell:Data,4(West_field Shoppingtown Eastgardens)')
		select('Table', 'cell:Data,5(152 Bunnerong Road)')
		assert_p('Table', 'Content', '[[Brand_Id, 1, , TAR, TAR], [Loc_Nbr, 2, , 5095, 5095], [Loc_Type, 3, , ST, ST], [Loc_Name, 4, , Eastgarden, Eastgarden], [Loc_Addr_Ln1, 5, , West_field Shoppingtown Eastgardens, West_field Shoppingtown Eastgardens], [Loc_Addr_Ln2, 6, , 152 Bunnerong Road, 152 Bunnerong Road], [Loc_Addr_Ln3, 7, , Eastgardens, Eastgardens], [Loc_Postcode, 8, , 2036, 2036], [Loc_State, 9, , NSW, NSW], [Loc_Actv_Ind, 10, , A, A]]')
		select('Table', 'cell:Data,5(152 Bunnerong Road)')
		click('Find1')
		select('TextField', 'West_')
		click('Find1')
		select('Table', 'cell:Data,4(West_field Shopping Centre)')
		assert_p('Table', 'Text', 'George Street', 'Data,5')
		select('Table', 'cell:Data,6(Hornsby)')
		assert_p('Table', 'Content', '[[Brand_Id, 1, , TAR, TAR], [Loc_Nbr, 2, , 5169, 5169], [Loc_Type, 3, , ST, ST], [Loc_Name, 4, , Hornsby, Hornsby], [Loc_Addr_Ln1, 5, , West_field Shopping Centre, West_field Shopping Centre], [Loc_Addr_Ln2, 6, , George Street, George Street], [Loc_Addr_Ln3, 7, , Hornsby, Hornsby], [Loc_Postcode, 8, , 2077, 2077], [Loc_State, 9, , NSW, NSW], [Loc_Actv_Ind, 10, , A, A]]')
		select('Table', 'cell:Data,6(Hornsby)')
		click('Find1')
		select('TextField', 'West_')
		click('Find1')
		select('Table', 'cell:Data,4(West_ Point Shopping Ctr)')
		assert_p('Table', 'Text', 'cell:Data,4(West_ Point Shopping Ctr)')
		select('Table', 'cell:Data,5(Balmoral Street)')
		assert_p('Table', 'Content', '[[Brand_Id, 1, , TAR, TAR], [Loc_Nbr, 2, , 5178, 5178], [Loc_Type, 3, , ST, ST], [Loc_Name, 4, , Blacktown - Not Yet Open, Blacktown - Not Yet Open], [Loc_Addr_Ln1, 5, , West_ Point Shopping Ctr, West_ Point Shopping Ctr], [Loc_Addr_Ln2, 6, , Balmoral Street, Balmoral Street], [Loc_Addr_Ln3, 7, , Blacktown, Blacktown], [Loc_Postcode, 8, , 2134, 2134], [Loc_State, 9, , NSW, NSW], [Loc_Actv_Ind, 10, , A, A]]')
		select('Table', 'cell:Data,5(Balmoral Street)')
		click('Find1')
		select('TextField', 'West_')
		click('Find1')
		select('Table', 'cell:Data,4(West_field Shoppingtown)')
		assert_p('Table', 'Text', 'cell:Data,4(West_field Shoppingtown)')
		select('Table', 'cell:Data,5(Matthews Avenue)')
		assert_p('Table', 'Content', '[[Brand_Id, 1, , TAR, TAR], [Loc_Nbr, 2, , 5168, 5168], [Loc_Type, 3, , ST, ST], [Loc_Name, 4, , Airport West, Airport West], [Loc_Addr_Ln1, 5, , West_field Shoppingtown, West_field Shoppingtown], [Loc_Addr_Ln2, 6, , Matthews Avenue, Matthews Avenue], [Loc_Addr_Ln3, 7, , Airport West, Airport West], [Loc_Postcode, 8, , 3042, 3042], [Loc_State, 9, , VIC, VIC], [Loc_Actv_Ind, 10, , A, A]]')
		select('Table', 'cell:Data,5(Matthews Avenue)')

		click('Find1')
		select('TextField', 'West_')
		select('ComboBox2', 'Backward')
		assert_p('ComboBox2', 'Text', 'Backward')

		click('Find1')
		select('Table', 'cell:Data,4(West_ Point Shopping Ctr)')
		assert_p('Table', 'Text', 'cell:Data,4(West_ Point Shopping Ctr)')
		select('Table', 'cell:Data,5(Balmoral Street)')
		assert_p('Table', 'Content', '[[Brand_Id, 1, , TAR, TAR], [Loc_Nbr, 2, , 5178, 5178], [Loc_Type, 3, , ST, ST], [Loc_Name, 4, , Blacktown - Not Yet Open, Blacktown - Not Yet Open], [Loc_Addr_Ln1, 5, , West_ Point Shopping Ctr, West_ Point Shopping Ctr], [Loc_Addr_Ln2, 6, , Balmoral Street, Balmoral Street], [Loc_Addr_Ln3, 7, , Blacktown, Blacktown], [Loc_Postcode, 8, , 2134, 2134], [Loc_State, 9, , NSW, NSW], [Loc_Actv_Ind, 10, , A, A]]')
		select('Table', 'cell:Data,4(West_ Point Shopping Ctr)')
		click('Find1')
		select('TextField', 'West_')
		click('Find1')
		select('Table', 'cell:Data,4(West_field Shopping Centre)')
		assert_p('Table', 'Text', 'cell:Data,4(West_field Shopping Centre)')
		select('Table', 'cell:Data,5(George Street)')
		assert_p('Table', 'Content', '[[Brand_Id, 1, , TAR, TAR], [Loc_Nbr, 2, , 5169, 5169], [Loc_Type, 3, , ST, ST], [Loc_Name, 4, , Hornsby, Hornsby], [Loc_Addr_Ln1, 5, , West_field Shopping Centre, West_field Shopping Centre], [Loc_Addr_Ln2, 6, , George Street, George Street], [Loc_Addr_Ln3, 7, , Hornsby, Hornsby], [Loc_Postcode, 8, , 2077, 2077], [Loc_State, 9, , NSW, NSW], [Loc_Actv_Ind, 10, , A, A]]')
		select('Table', 'cell:Data,5(George Street)')
		click('BasicInternalFrameTitlePane$NoFocusButton2')
		click('BasicInternalFrameTitlePane$NoFocusButton2')
##		click('BasicInternalFrameTitlePane$NoFocusButton5')
		#select('Table', 'cell:4|Loc_Name,1(VIC West Ad Support)')
		#click('MetalInternalFrameTitlePane', 396, 14)
		#click('BasicInternalFrameTitlePane$NoFocusButton2')

		#close()
		if window('Save Changes to file: ' + commonBits.sampleDir() + 'Ams_LocDownload_20041228.bin'):
			click('No')
		close()
	close()
